package com.example.travel.service;


import com.example.travel.bean.ActivityBean;
import com.example.travel.bean.FeedbackBean;
import com.example.travel.mapper.ActivityMapper;
import com.example.travel.mapper.FeedbackMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackService {
    @Autowired
    FeedbackMapper feedbackMapper;

    public List<FeedbackBean> getFeedbackList(int offset, int pageSize) {
        return feedbackMapper.getFeedbackList();
    }

    public List<FeedbackBean> getFeedbackListKeyword(int offset, int pageSize,String keyword) {
        return feedbackMapper.getFeedbackListKeyword(keyword);
    }


    public int addFeedback(FeedbackBean feedback) {
        return feedbackMapper.addFeedback(feedback);
    }

    // 获取所有反馈内容用于生成词云
    public String getAllFeedbackTextForWordCloud() {
        return feedbackMapper.getAllFeedbackTextForWordCloud();
    }

    // 获取反馈列表（分页）
//    public List<FeedbackBean> getFeedbackList(int page, int size) {
//        int offset = (page - 1) * size;
//        return feedbackMapper.getFeedbackList(offset, size);
//    }

    // 获取反馈总数
    public int getFeedbackCount() {
        return feedbackMapper.getFeedbackCount();
    }

}
